package com.zjjt.dc.common.util;

import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

public class ResourcesJsonUtil {
    public static JSONObject getResourcesJson(String filePath) {
        JSONObject result = null;
        try {
            ClassPathResource resource = new ClassPathResource(filePath);
            String jsonContent = resource.readUtf8Str();
            if (JSONUtil.isTypeJSON(jsonContent)) {
                JSONObject root = JSONUtil.parseObj(jsonContent);
                result = root;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}
